using Microsoft.Xna.Framework.Input;

namespace CthulhuDomain.StageManagement
{
  public class MenuItem
  {
    private IGameServiceProvider GameServiceManager { get; set; }
    public MenuItem(IGameServiceProvider gameServiceProvider) {
      GameServiceManager = gameServiceProvider;
    }

    public bool Selected { get; set; }
    public string Text { get; set; }
    public IColor BackgroundColor { get; set; }
    public IGraphicResource Font { get; set; }
    public IVector2 Position { get; set; }
    public IColor ForeColor { get; set; }
    public IRectangle Dimension { get; set; }

    public MenuCommand Command { get; set; }
    public void Draw() {

      GameServiceManager.SpriteBatch.DrawString(Font, Selected ? string.Format("* {0}",Text) : Text,  Position, ForeColor);
    }

    public void Update(Keys[] keys) {
      if (Selected)
        Command.Execute(keys);
    }
  }
}